# -*- coding: utf-8 -*-
# @Product Name: 
# @Author  :    wyp
# @Time    :    2022/1/5 下午5:13
# @Description:

import sqlite3

conn = sqlite3.connect('database.db')

with open('db.sql') as f :
    conn.executescript(f.read())

cur = conn.cursor()

cur.execute('insert into posts (title, content) values (?,?)',
            ('学习flask1','这是第一课'))

cur.execute('insert into posts (title, content) values (?,?)',
            ('学习flask2','这是第二课'))

conn.commit()
conn.close()